import mongoose from "mongoose";
const bookSchema = new mongoose.Schema({
    name: {
        type: String,
        required: true
    },
    author: {
        type: String,
        required: true
    },
    cover: {
        type: String,
    },
    category: {
        type: mongoose.Schema.Types.ObjectId,
        ref: 'Category'
    },
    stock: {
        type: Number,
        default: 0,
    },
    description: {
        type: String,
    },
    publishAt: {
        type: Number,
        default: null
    },
    createAt: {
        type: Number,
        default: null
    },
    updateAt: {
        type: Number,
        default: null
    }
})

export default bookSchema;